package org.feng.demofx.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 动物类型枚举
 *
 * @author feng
 */
@Getter
@AllArgsConstructor
public enum AnimalTypeEnum implements BaseEnum {
    DOG(0, "狗"),
    CAT(1, "猫"),
    UN_KNOW(-1, "未知"),
    ;

    private final int code;
    private final String desc;

    public static AnimalTypeEnum getByCode(Integer code) {
        return BaseEnum.convertToEnum(code, AnimalTypeEnum.class);
    }

    public static AnimalTypeEnum getByDesc(String desc) {
        return BaseEnum.convertToEnum(desc, AnimalTypeEnum.class);
    }
}
